package tw.com.softleader.json.jackson.app;

import java.io.InputStream;

import tw.com.softleader.json.jackson.entity.Question09Entity;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.joda.JodaModule;

public class Question09App {
	
	public static void main(String[] args) {

		// Read file as InputStream..
		InputStream in = Question09App.class.getResourceAsStream("/question09.json");

		Question09Entity q09Entity = null;
		try {
			// TODO 請將 q09Entity 載入 question09.json 的資料, 注意有 joda-time 的格式需要處理
			// 請註冊一個 Serializer 且修改 Question09Entity 取使用該 Serializer
			
			ObjectMapper objectMapper = new ObjectMapper();	
			
			objectMapper.registerModule(new JodaModule());
			
			q09Entity = objectMapper.readValue(in, Question09Entity.class) ;
			
			
		} catch (Exception e) {
			e.printStackTrace();
		}

		System.out.println(q09Entity);

	}
}
